package com.geeguo.ebuilder.client.base.tenant.remote;

import com.geeguo.ebuilder.client.base.core.constants.FeignNameConstants;
import com.geeguo.ebuilder.client.base.tenant.remote.fallback.TenantInfoApiFallback;
import com.geeguo.ebuilder.client.base.tenant.model.TenantInfoRO;
import com.geeguo.ebuilder.core.common.action.ActionResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = FeignNameConstants.EBUILDER_OPERATION_API_NAME, fallback = TenantInfoApiFallback.class)
public interface TenantInfoApi {

    @GetMapping("/tenant/tenantInfo/listValid")
    ActionResult<List<TenantInfoRO>> listValid();

    @GetMapping("/tenant/tenantInfo/getByCode/{code}")
    ActionResult<TenantInfoRO> getByCode(@PathVariable("code") String code);

    @GetMapping("/tenant/tenantInfo/getByDomain/{domain}")
    ActionResult<TenantInfoRO> getByDomain(@PathVariable("domain") String domain);
}